<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2021/7/21
 * Time: 9:36
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);

namespace app\common\validate;


use think\Validate;

class Category extends Validate
{
    protected $rule = [
        "pid" => "require|egt:0",
        //"icon" => "require",
        "title" => "require|max:32",
        "id" => "require|integer|egt:0",
        "value" => "require",
        "field" => "require|max:32"
    ];
    protected $message = [
        "pid.require" => "请选择父级分类",
        "pid.egt" => "分类异常!请刷新页面后重试",
        "icon.require" => "请选择图标",
        "title.require" => "请输入分类名称",
        "title.max" => "分类名称长度不能超过32位字符",
        "id.require" => "参数不完整！请刷新后重试",
        "id.integer" => "参数类型不正确",
        "id.egt" => "参数类型不正确",
        "value.require" => "值不完整",
        "field.require" => "请输入名称",
        "field.max" => "名称最长不能超过32位"
    ];
    protected $scene = [
        "add" => ["pid", "title"],
        "update" => ["id", "field", "value"]
    ];
}